package com.zhao.system.poro;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Objects;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * <p>
 *
 * </p>
 *
 * @author xiaozhao
 * @since 2020-11-08
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Book对象", description="")
public class Book implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "图书id")
    private Integer bid;

    @ApiModelProperty(value = "图书名称")
    private String name;

    @ApiModelProperty(value = "作者")
    private String author;

    @ApiModelProperty(value = "书室id")
    private Integer roomid;

    @ApiModelProperty(value = "图书类型的id")
    private Integer btid;

    @ApiModelProperty(value = "图书的数量")
    private Integer num;

    @ApiModelProperty(value = "逻辑删除")
    private Integer statue;

    //@TableField(exist = false)表示不是数据中存在的字段
    @TableField(exist = false)
    @ApiModelProperty(value = "图书室名")
    private String RoomName;

    @TableField(exist = false)
    @ApiModelProperty(value = "图书室地址")
    private String RoomAdress;


    @TableField(exist = false)
    @ApiModelProperty(value = "图书的类型")
    private String BookType;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Book book = (Book) o;
        return Objects.equals(bid, book.bid) &&
                Objects.equals(name, book.name) &&
                Objects.equals(author, book.author) &&
                Objects.equals(roomid, book.roomid) &&
                Objects.equals(btid, book.btid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(bid, name, author, roomid, btid);
    }
}

